/**   
 * @Title: TestLog.java 
 * @Package cn.edu.cdtu.healthserver.domain 
 * @Description: TODO 
 * @author  
 * @date 
 * @version V0.0   
 */
package cn.edu.cdtu.healthserver.domain;

import java.sql.Timestamp;


/** 
 * @ClassName: TestLog 
 * @Description: TODO
 * @author 
 * @date 
 *  
 */
public class TestLog {

	private int id;
	private int user_id;
	private int test_id;
	private Timestamp date;
	private int point_sum;
	/** 
	 * @Title: TestLog
	 * @Description: TODO
	 * @throws 
	 *
	 */
	public TestLog() {
	}
	/** 
	 * @Title: TestLog
	 * @Description: TODO
	 * @throws 
	 *
	 * @param user_id
	 * @param test_id
	 * @param date
	 * @param point_sum
	 */
	public TestLog(int user_id, int test_id, Timestamp date, int point_sum) {
		this.user_id = user_id;
		this.test_id = test_id;
		this.date = date;
		this.point_sum = point_sum;
	}
	/** 
	 * @Title: TestLog
	 * @Description: TODO
	 * @throws 
	 *
	 * @param id
	 * @param user_id
	 * @param test_id
	 * @param date
	 * @param point_sum
	 */
	public TestLog(int id, int user_id, int test_id, Timestamp date,
			int point_sum) {
		this.id = id;
		this.user_id = user_id;
		this.test_id = test_id;
		this.date = date;
		this.point_sum = point_sum;
	}
	/**
	 * @return the id
	 */
	public int getId() {
		return id;
	}
	/**
	 * @param id the id to set
	 */
	public void setId(int id) {
		this.id = id;
	}
	/**
	 * @return the user_id
	 */
	public int getUser_id() {
		return user_id;
	}
	/**
	 * @param user_id the user_id to set
	 */
	public void setUser_id(int user_id) {
		this.user_id = user_id;
	}
	/**
	 * @return the test_id
	 */
	public int getTest_id() {
		return test_id;
	}
	/**
	 * @param test_id the test_id to set
	 */
	public void setTest_id(int test_id) {
		this.test_id = test_id;
	}
	/**
	 * @return the date
	 */
	public Timestamp getDate() {
		return date;
	}
	/**
	 * @param date the date to set
	 */
	public void setDate(Timestamp date) {
		this.date = date;
	}
	/**
	 * @return the point_sum
	 */
	public int getPoint_sum() {
		return point_sum;
	}
	/**
	 * @param point_sum the point_sum to set
	 */
	public void setPoint_sum(int point_sum) {
		this.point_sum = point_sum;
	}
	/* (non-Javadoc)
	 * <p>Title: hashCode</p> 
	 * <p>Description: </p> 
	 * @return 
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((date == null) ? 0 : date.hashCode());
		result = prime * result + id;
		result = prime * result + point_sum;
		result = prime * result + test_id;
		result = prime * result + user_id;
		return result;
	}
	/* (non-Javadoc)
	 * <p>Title: equals</p> 
	 * <p>Description: </p> 
	 * @param obj
	 * @return 
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		TestLog other = (TestLog) obj;
		if (date == null) {
			if (other.date != null)
				return false;
		} else if (!date.equals(other.date))
			return false;
		if (id != other.id)
			return false;
		if (point_sum != other.point_sum)
			return false;
		if (test_id != other.test_id)
			return false;
		if (user_id != other.user_id)
			return false;
		return true;
	}
	/* (non-Javadoc)
	 * <p>Title: toString</p> 
	 * <p>Description: </p> 
	 * @return 
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "TestLog [id=" + id + ", user_id=" + user_id + ", test_id="
				+ test_id + ", date=" + date + ", point_sum=" + point_sum + "]";
	}
	/**
	 * 
	 * @Title: equalsWithoutId 
	 * @Description: 去除ID的等同性判断
	 * @return boolean
	 * @throws 
	 *
	 * @param obj
	 * @return
	 */
	public boolean equalsWithoutId(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		TestLog other = (TestLog) obj;
		if (date == null) {
			if (other.date != null)
				return false;
		} else if (!date.equals(other.date))
			return false;
		if (point_sum != other.point_sum)
			return false;
		if (test_id != other.test_id)
			return false;
		if (user_id != other.user_id)
			return false;
		return true;
	}
}
